package com.yuyou.train.user.mapper;

import com.yuyou.train.user.vo.resp.RespUserPointsTop;
import org.apache.ibatis.annotations.Mapper;

import com.yuyou.train.service.api.user.entity.UserPoints;
import org.apache.ibatis.annotations.Param;
import org.omg.CORBA.INTERNAL;

import java.util.List;

@Mapper
public interface UserPointsMapper {
    int deleteByPrimaryKey(String id);

    int insert(UserPoints record);

    UserPoints selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(UserPoints record);

    Integer sumPointsByUserId(@Param(value = "userId") String userId, @Param(value = "action") String action);

    List<RespUserPointsTop> findUserPointsTop(String classId);

    Integer myRank(@Param(value = "classId")String classId, @Param(value = "userId") String userId);

    Integer countUserOfPoints(String classId);

}